package xyz.wanwanwan.www.hrm.feign.fallback;

import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import xyz.wanwanwan.www.hrm.domain.CourseDetail;
import xyz.wanwanwan.www.hrm.domain.CourseMarket;
import xyz.wanwanwan.www.hrm.feign.client.CourseMarketClient;
@Component
@Slf4j
public class CourseMarketClientFallbackFactory implements FallbackFactory<CourseMarketClient> {

    @Override
    public CourseMarketClient create(Throwable throwable) {
        log.error("课程详情回调，查询课程详情失败");
        return new CourseMarketClient() {
            @Override
            public CourseMarket get(Long id) {
                log.error("课程详情回调，查询课程详情失败");
                return new CourseMarket();
            }
        };
    }
}
